package com.eight.travel.exception;

import com.eight.travel.utils.BaseResp;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
@ResponseBody
public class MyException  {

    @ExceptionHandler(AddFailException.class)
    public BaseResp exceptionHandler(Exception e){
        System.out.println("全局异常捕获>>>:"+e);
        return new BaseResp().SUCCESS("添加失败",null,0);
    }
}

